<template>
    <div>
        <div @click ="xxx">adsfa</div>

            <slider></slider>
            <booklist @haha="xxx"></booklist>

            <book-list :books="slides"
                       heading="最新更新"
                       @haha="xxx">
            </book-list>

            <book-list :books="books"
                       heading="编辑推荐"
                       @haha="xxx">
            </book-list>
        </div>
</template>
<<script type="text/ecmascript-6">
    import slider from "./slider.vue"
    import booklist from "./list.vue"

    export default{
        props:['announcement','slides'],
        created (){
            this.$http.get('/data.json').then(res=> {
                this.announcement = res.body.announcement
                this.slides = res.body.slides
                this.lastupdatebooks = res.body.lastupdatebooks
                this.recommended = res.body.recommended
            })
        },

        data(){
            return{
                lastupdatebooks:[],
                announcement:'',
                slides:[],
                recommended:[]
            }
        },
        methods: {
            xxx (){
                window.alert("hahahah")
            }
        }
    }
</script>